#include"LOVE.h"
void color(int k)
{
	SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), k);
}
////////////////////////////////////////////////////////////////////////////////
void rpplove(int l, int r, int a, int b,int n)
{
	srand((unsigned int)time(NULL));
	for (int i = 1; i <= n;i++)
	{
		if (i <= b && i >= a)
		{
			printf("  ");
		}
		else if (i >= l && i <= r)
		{
			char e = 97 + rand() % (122 - 97 + 1);
			Sleep(200);
			printf(" %c", e);
		}
		else
		{
			printf("  ");
		}
	}
	printf("\n");
}
void rplove(int l, int r, int a, int b,int n)
{
	if (r - b == 1 || r - b == 2)
	{
		rpplove(l, r, a, b,n);
		return;
	}
	else
	{
		rplove(l + 1, r - 1, a - 1, b + 1,n);
		rpplove(l, r, a, b,n);
		return;
	}
}
void rPLove(int n)
{
	int left = 1, right = n;
	int x = n / 2 + 1;
	rplove(left,right,x,x,n);
	for (int i = 1; i <= n; i++)
	{
		char u = 97 + rand() % (122 - 97 + 1);
		Sleep(200);
		printf(" %c", u);
	}
	printf("\n");
	for (int j = 1; j <= x; j++)
	{
		for (int i = 1; i <= n; i++)
		{
			char u = 97 + rand() % (122 - 97 + 1);
			if (i >= left && i <= right)
			{
				Sleep(200);
				printf(" %c", u);
			}
			else
			{
				printf("  ");
			}
		}
		printf("\n");
		left++;
		right--;
	}
}
//////////////////////////////////////////////////////////////////////////////////////
void fpplove(int l, int r, int a, int b, int n)
{
	srand((unsigned int)time(NULL));
	for (int i = 1; i <= n; i++)
	{
		if (i <= b && i >= a)
		{
			printf("  ");
		}
		else if (i >= l && i <= r)
		{
			char e = 97 + rand() % (122 - 97 + 1);
			printf(" %c", e);
		}
		else
		{
			printf("  ");
		}
	}
	printf("\n");
}
void fplove(int l, int r, int a, int b, int n)
{
	if (r - b == 1 || r - b == 2)
	{
		fpplove(l, r, a, b, n);
		return;
	}
	else
	{
		fplove(l + 1, r - 1, a - 1, b + 1, n);
		fpplove(l, r, a, b, n);
		return;
	}
}
void fPLove(int n)
{
	int left = 1, right = n;
	int x = n / 2 + 1;
	fplove(left, right, x, x, n);
	for (int i = 1; i <= n; i++)
	{
		char u = 97 + rand() % (122 - 97 + 1);
		printf(" %c", u);
	}
	printf("\n");
	for (int j = 1; j <= x; j++)
	{
		for (int i = 1; i <= n; i++)
		{
			char u = 97 + rand() % (122 - 97 + 1);
			if (i >= left && i <= right)
			{
				printf(" %c", u);
			}
			else
			{
				printf("  ");
			}
		}
		printf("\n");
		left++;
		right--;
	}
	printf("\n");
	printf("\n");
	printf("\n");
	printf("\n");
	printf("\n");
	printf("\n");
	printf("\n");
	printf("\n");
	printf("\n");
}